import request from '@/utils/request'

const serviceName = '/basedata'

export function tree(data) {
  return request({
    url: `${serviceName}/dictionary/tree`,
    method: 'get',
    params: data
  })
}

export function getByCateCode(data) {
  return request({
    url: `${serviceName}/dictionary/by/category/code`,
    method: 'get',
    params: data
  })
}

export function create(data) {
  return request({
    url: `${serviceName}/dictionary/create`,
    method: 'post',
    data
  })
}

export function update(data) {
  return request({
    url: `${serviceName}/dictionary/update`,
    method: 'post',
    data
  })
}

export function remove(data) {
  return request({
    url: `${serviceName}/dictionary/delete`,
    method: 'post',
    data
  })
}

export function categoryTree() {
  return request({
    url: `${serviceName}/dictionary/category/tree`,
    method: 'get'
  })
}

export function createCate(data) {
  return request({
    url: `${serviceName}/dictionary/category/create`,
    method: 'post',
    data
  })
}

export function updateCate(data) {
  return request({
    url: `${serviceName}/dictionary/category/update`,
    method: 'post',
    data
  })
}

export function deleteCate(data) {
  return request({
    url: `${serviceName}/dictionary/category/delete`,
    method: 'post',
    data
  })
}
